<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>class类的语法</title>
</head>
<body>
    <script>
        // 第一种
        // let User = class{
        //     get(){
        //         console.log(23521);
        //     }
        // };


        // 第二种
        class User{
            constructor(name){
                this.name = name;
            }
            get(){
                console.log(this.name);
            }
        }
        let hd = new User('后盾人');
        hd.get();
    </script>
</body>
</html>